bcm-specs

[Specification

  1. Save the Current Channel
  2. Set the Channel to 0x40
  3. Backup MMIO offset 0x3F4

  4. Backup PHYRegisters 0x10, 0x11, 0x7A, 0x6E, 0x7C, 0x9, 0x6B

  5. Backup InternalLookupTable 0x3C00 offsets 0x7, 0x9, 0xA

  6. Backup InternalLookupTable 0x3800 offset 0xB

  7. Backup RadioRegisters 0x17, 0x19, 0x9

  8. Backup InternalLookupTable 0x3000 offset 0x1

  9. Bitwise AND RadioRegister 0x9 with 0xFFBF

  10. Write 0 to RadioRegister 0x1E

  11. Unset bit 0x8000 in the APHY All CRS register (PHYRegister 0x29)

  12. Write 1 to MMIO offset 0x3F4

  13. Bitwise OR PHYRegister 0x10 with 0xC08

  14. MaskSet PHYRegister 0x11 with mask 0xF3F7 and set with 0x408

  15. Read the value of InternalLookupTable 0x3800 offset 0x8 and write it to InternalLookupTable 0x3C00 offset 0x7

  16. Write 1 to InternalLookupTable 0x3C00 offset 0x9

  17. Write 1 to InternalLookupTable 0x3C00 offset 0xA

  18. Write 1 to InternalLookupTable 0x3800 offset 0xB

  19. Write 0xC111 to PHYRegister 0x7A

  20. Write 0x0002 to PHYRegister 0x7C

  21. If the PHY Revision is 2 or less
    1. RSSI InternalLookupTable Workaround

  22. Write 0 to PHYRegister 0x6B

  23. Write 0x26 to RadioRegister 0x17

  24. If the PHY Version is 1
    1. MaskSet the value of InternalLookupTable 0x3000 with mask 0xFFFFFF87 and set with 0x10

  25. Otherwise
    1. MaskSet the value of InternalLookupTable 0x3000 with mask 0xFFFFFFC3 and set with 0x8

  26. Write 0x60 to RadioRegister 0x19

  27. Start with a saved Collected TSSI Value of -999999
  28. Loop over the "Radio Register 1E" table below
    1. If this is one of the first 5 table elements
      1. Bitwise AND the value of RadioRegister 0x1E with 0xF

      2. Left shift the table value by 4 and bitwise OR with the result
    2. Otherwise
      1. Bitwise AND the value of RadioRegister 0x1E with 0xF0

      2. Bitwise OR the table value with the result
    3. Write the result to RadioRegister 0x1E

    4. Delay 5 uSecs
    5. LOFT Collect TSSI Value

    6. If the Collected TSSI Value is greater than the saved Collected TSSI Value
      1. Save the value of RadioRegister 0x1E (as a signed 16 bit value)

      2. Save the new Collected TSSI Value
      3. Start (or restart) an array of values of RadioRegister 0x1E, keep two arrays, one for the first 5 table elements and one for the second 5 table elements

    7. Otherwise, if the Collected TSSI Value is equal to the saved Collected TSSI Value
      1. Read the value of RadioRegister 0x1E and add it to the correct array

    8. If this is the 5th or 10th table element
      1. Write the saved value of RadioRegister 0x1E to RadioRegister 0x1E

  29. Write 0x91 to RadioRegister 0x19

  30. If there were no values for the second table elements array
    1. Add a 0 as the only element
  31. Save the saved RadioRegister 0x1E value (this is the previous loop's final saved RadioRegister 0x1E value referenced below)

  32. Start with a saved Collected TSSI Value of -999999
  33. Loop over the first table elements array
    1. Loop over the second table elements array
      1. Take the current first table elements array item and bitwise AND with 0xF0
      2. Take the current second table elements array item and bitwise AND with 0xF
      3. Write the Bitwise OR of the two results above to RadioRegister 0x1E

      4. Delay 5 uSecs
      5. LOFT Collect TSSI Value

      6. If the Collected TSSI Value is greater than the saved Collected TSSI Value
        1. Save the value of RadioRegister 0x1E (as a signed 16 bit value)

  34. If the saved RadioRegister 0x1E value is less than 0

    1. Write the previous loop's final saved RadioRegister 0x1E value to RadioRegister 0x1E

  35. Otherwise
    1. Write the saved value of RadioRegister 0x1E to RadioRegister 0x1E

  36. Save the value of RadioRegister 0x1E for use in other functions

  37. Restore MMIO offset 0x3F4

  38. Restore PHYRegisters 0x10, 0x11

  39. Restore InternalLookupTable 0x3000 offset 1

  40. Restore RadioRegisters 0x17, 0x19

  41. Restore PHYRegister 0x6B

  42. Restore InternalLookupTable 0x3C00 offsets 0x7, 0x9, 0xA

  43. Restore InternalLookupTable 0x3800 offset 0xB

  44. Restore PHYRegisters 0x7A, 0x6E, 0x7C

  45. If the PHY Revision is 2 or less
    1. RSSI InternalLookupTable Workaround

  46. Do a DummyTransmission

  47. Set bit 0x8000 in the APHY All CRS register (PHYRegister 0x29)

  48. Write 0 to PHYRegister 0x6B

  49. Write 0x26 to RadioRegister 0x17

  50. If the PHY Version is 1 or less
    1. MaskSet the value of InternalLookupTable 0x3000 offset 1 with mask 0xFFFFFF87 and set with 0x58

  51. Otherwise
    1. MaskSet the value of InternalLookupTable 0x3000 offset 1 with mask 0xFFFFFFC3 and set with 0x2C

  52. Start with a saved Collected TSSI Value of -999999
  53. Loop twice
    1. Start with a Loop Counter Value of 5
    2. While the saved Collected TSSI Value is lower than the Maximum Collection Value (see below) and the Loop Counter Value is 0 or higher
      1. Write the Abstuf Table value corresponding to the current Loop Counter Value to RadioRegister 0x19

      2. Loop from -15 to 15
        1. Read the value of
        2. If this is the first time through the initial loop
          1. Left shift the absolute value of the inner loop position and bitwise OR the result of that with the value of PHYRegister 0x6B bitwise AND'd with 0xFF

          2. Write the result to PHYRegister 0x6B

        3. Otherwise (the second time through the initial loop)
          1. Bitwise AND the value of PHYRegister 0x6B with 0xFFFFFF00 and bitwise OR it with the absolute value of the inner loop position

          2. Write the result to PHYRegister 0x6B

        4. LOFT Collect TSSI Value

        5. If the Collected TSSI Value is greater than the saved Collected TSSI Value
          1. Save the value of PHYRegister 0x6B (as a signed 16 bit value)

          2. Save the new Collected TSSI Value
          3. Start (or restart) an array of values of PHYRegister 0x6B, keep two arrays, one for the first time through the initial loop and one for the second

        6. Otherwise, if the Collected TSSI Value is equal to the saved Collected TSSI Value
          1. Add the current value of PHYRegister 0x6B to the appropriate array

        1. If the saved Collected TSSI Value is less than the Maximum Collection Value (see below)
          1. Decrement the Loop counter Value
          2. FIXME I need to check this again, it looks wrong

  54. Start with a Loop Counter Value of 5 and use the two arrays from the previous loop in the loop below
  55. While the saved Collected TSSI Value is lower than the Maximum Collection Value (see below) and the Loop Counter Value is 0 or higher
    1. Write the AbsI Table value corresponding to the current Loop Counter Value to RadioRegister 0x19

    2. If there are no elements in the second array, add 0 as the first element
    3. Backup the saved value of PHYRegister 0x6B (The previously saved value used below)

    4. Start with a saved Collected TSSI Value of -999999
    5. If there are any elements in the first array
      1. Loop over the elements in the first array (limited to 16)
        1. Loop over the elements in the second array (limited to 16)
          1. Bitwise AND the current first array value with 0xFFFFFF00
          2. Bitwise AND the current second array value with 0xFF
          3. Write the bitwise OR of the two values above to PHYRegister 0x6B

          4. LOFT Collect TSSI Value

          5. If the Collected TSSI Value is greater than the saved Collected TSSI Value
            1. Save the value of PHYRegister 0x6B

            2. Save the new Collected TSSI Value
      1. If the Collected TSSI Value is less than the Maximum Collection Value (see below)
        1. Decrement the Loop Counter Value
  56. If we didn't save a new value for the saved value of PHYRegister 0x6B

    1. Use the previously saved value of PHYRegister 0x6B as the saved value of PHYRegister 0x6B

  57. Restore MMIO offset 0x3F4

  58. Restore PHYRegisters 0x10, 0x11

  59. Restore InternalLookupTable 0x3000 offset 1

  60. Restore RadioRegisters 0x17, 0x19

  61. Write the saved value of PHYRegister 0x6B to PHYRegister 0x6A

  62. Restore PHYRegister 0x6B

  63. Delay 10 uSecs
  64. Restore InternalLookupTable 0x3C00 offsets 0x7, 0x9, 0xA

  65. Restore InternalLookupTable 0x3800 offset 0xB

  66. Restore PHYRegisters 0x7A, 0x6E, 0x7C

  67. If the PHY Revision is 2 or less
    1. RSSI InternalLookupTable Workaround

  68. Do a DummyTransmission

  69. Set bit 0x8000 in the APHY All CRS register (PHYRegister 0x29)

  70. Restore RadioRegister 0x9

  71. Set the channel to the saved current channel

Radio Register 1E Table

Loop Position

Value

0

0

1

4

2

8

3

9

4

0xD

5

0

6

1

7

5

8

6

9

0xA

Maximum Collection Value

PHY Revision

Value

3 or greater

0xFFFFFFC3

Otherwise

0xFFFFFF06

AbsI Table

0x60

0x61

0x62

0x91

0x9A

0x9B

0x9C

Abstuf Table

0x20

0x60

0x61

0x62

0x91

0x92

0x93

0x94

0x9C


Exported/Archived from the wiki to HTML on 2016-10-27